import { ApiReturn } from './api-return.entity'
import { ApiParam } from './api-param.entity'
import { Entity, PrimaryGeneratedColumn, OneToMany, Column } from 'typeorm'

@Entity()
export class Api {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  name: string

  @Column()
  description: string

  @Column()
  type: string

  @OneToMany(type => ApiReturn, ret => ret.api)
  returns: ApiReturn[]

  @OneToMany(type => ApiParam, param => param.api)
  params: ApiParam[]
}
